//
//  KDMLoginViewController.m
//  KouDaiMaster
//
//  Created by 范智渊 on 2018/4/13.
//  Copyright © 2018年 zzgk. All rights reserved.
//

#import "KDMLoginViewController.h"
#import "KDMLoginView.h"
@interface KDMLoginViewController ()

@end

@implementation KDMLoginViewController
singleton_implementation(KDMLoginViewController);

-(void)viewWillAppear:(BOOL)animated {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(vcodeLoginSuccess) name:@"vcodeLoginSuccess" object:nil];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    KDMLoginView *wsLoginV = [[KDMLoginView alloc]initWithFrame:self.view.bounds];
    wsLoginV.titleLabel.textColor = [UIColor grayColor];
    [self.view addSubview:wsLoginV];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(vcodeLoginSuccess) name:@"vcodeLoginSuccess" object:nil];
    [wsLoginV setClickBlock:^(NSString *textField1Text, NSString *textField2Text) {

        UIStoryboard *main = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        UITabBarController *tabBarVC = [main instantiateViewControllerWithIdentifier:@"TabBarID"];

        [self presentViewController:tabBarVC animated:YES completion:nil];

    }];
    
}



- (void)vcodeLoginSuccess {
    [self dismissViewControllerAnimated:YES completion:nil];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
